<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddShopIdToWaimai extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('waimai_callback_logs', function (Blueprint $table) {
            $table->unsignedInteger('shopId')->default(0)->after('orderId')->index('idx_shopId');
            $table->unsignedTinyInteger('callType')->default(0)->after('route')->index('idx_callType');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('waimai_callback_logs', function (Blueprint $table) {
            $table->dropColumn('shopId');
            $table->dropColumn('callType');
        });
    }
}
